home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games: Greatest Hits 1996 / Amiga Games: Greatest Hits 1996.iso / userbox / publicdomain / fractal / usage < prev    next >
Text File  |  1996-07-02  |  2KB  |  84 lines

  1.  
  2. This is a very brief note on usage of enc.c and dec.c and on raw image
  3. files.
  4.  
  5. FILE TYPE:
  6.  
  7. First, the input file to enc must be raw bytes which are not
  8. references into a color lookup table. The image size must
  9. be a multiple of 4. A typical calling sequence for a 256x256 image is:
  10.  
  11. enc -t 10 infile.raw outfile.trn
  12.  
  13.  
  14.  
  15. THE TOLERANCE FLAG:
  16.  
  17. A range of 4-20 is reasonable for the -t flag, with small values
  18. giving good fidelity at poor compression and vice versa. 
  19.  
  20.  
  21.  
  22. INPUT IMAGE SIZE:
  23.  
  24. The -M flag controls the size of the smallest image pieces that are
  25. compared for self similarity. The following table gives the value
  26. that should be used:
  27.  
  28. Smallest Input Image Dimension                  -M value
  29. --------------------------------------------------------
  30.    128                                            5
  31.    256                                            6 (default)
  32.    512                                            7 
  33. etc.
  34.  
  35. Using too large a -M will cause the program to warn you that it 
  36. doesn't make sense to do that (the resulting compression will
  37. be poor); using too small a -M flag will cause the resulting fidelity
  38. to be poor (often, but not always). 
  39.  
  40. For (say) 512x512 images the calling sequence is:
  41.  
  42. enc -t 10 -M 7 -w 512 infile.raw outfile.trn
  43.  
  44. The -M flags should probably be automatic; oh well. 
  45.  
  46. DECODING: 
  47.  
  48. The decoding call is:
  49.  
  50. dec outfile.trn outfile.out
  51.  
  52. which creates a raw byte image outfile.out. 
  53.  
  54. The outputfile can be scaled with the -f flag. 
  55.  
  56. dec -f 2 outfile.trn outfile.out 
  57.  
  58. will result in an outputfile that is twice as big as the 
  59. input. 
  60.  
  61.  
  62. VIEWING THE IMAGE:
  63.  
  64. The file Images/r2s.c will create sunraster header. It can be prepended
  65. to the raw data files to convert them to sunraster format. To use
  66. r2s.c, compile it (cc -o r2s.c r2s), and then type 
  67. r2s 256 256 > head
  68. cat head imagefile.raw > imagefile.ras 
  69. which will create a head file for a 256x256 sunraster file and prepend
  70. it to the raw image file.... 
  71.  
  72. All of this should be automated; maybe it will be some day....
  73.  
  74. CREATING RAW FILES: 
  75. ras2raw.c is a C program to convert just some types of sunraster images 
  76. (no run length encoding, sorry) to raw byte files. It is in the Images
  77. directory with the raw images. 
  78.  
  79. -----
  80.  
  81. Good luck; thanks for your interest. 
  82. Yuval Fisher
  83. yfisher@ucsd.edu
  84.